package com.aeon.asm;

import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
import static org.objectweb.asm.Opcodes.*;

public class PerfClassAdapter extends ClassVisitor {
	private String className;

	public PerfClassAdapter(ClassVisitor visitor, String theClass) {
		super(ASM4, visitor);
		this.className = theClass;
	}

	public MethodVisitor visitMethod(int arg, String name, String descriptor,
			String signature, String[] exceptions) {
		MethodVisitor mv = super.visitMethod(arg, name, descriptor, signature,
				exceptions);
		if (name.equals("<init>")) {
			return mv;
		}
		MethodVisitor ma = new PerfMethodAdapter(mv, className, name);
		return ma;
	}

}
